<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        // 1.声明一个数组
        var arr = new Array();
        //2.给数组赋值，10个随机数
        //循环语句：for
        for(var i=0;i<10;i++){
            arr[i]=Math.ceil(Math.random()*100);
        }

        //3.输出数组
        console.log(arr);

        //4.对数组排序
        arr.sort(function(a,b){
            return a-b;
        });

        //5.重新输出排序后的数组
        console.log(arr);
        
    </Script>
</head>
<body>
    
</body>
</html>